package com.hadwinling.blog.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.hadwinling.blog.entity.Money;
import com.hadwinling.blog.mapper.MoneyMapper;
import com.hadwinling.blog.service.MoneyService;

import java.util.*;

/**
 * @author HadwinLing
 * @version V1.0
 * @Package com.hadwinling.blog.service.impl
 * @date 2020/8/29 16:18
 */
@Service
public class MoneyServiceImpl implements MoneyService {

    @Resource
    private MoneyMapper moneyMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return moneyMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Money record) {
        return moneyMapper.insert(record);
    }

    @Override
    public int insertSelective(Money record) {
        return moneyMapper.insertSelective(record);
    }

    @Override
    public Money selectByPrimaryKey(Integer id) {
        return moneyMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Money record) {
        return moneyMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Money record) {
        return moneyMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Money> selectAllByAdminidAndState(Integer adminid, Integer state) {
        return moneyMapper.selectAllByAdminidAndState(adminid, state);
    }

    @Override
    public List<Money> selectTagByAdminidAndState(Integer adminid, Integer state) {
        return moneyMapper.selectTagByAdminidAndState(adminid, state);
    }

    @Override
    public int updateStateByIdAndAdminid(Integer updatedState, Integer id, Integer adminid) {
        return moneyMapper.updateStateByIdAndAdminid(updatedState, id, adminid);
    }

    @Override
    public List<Money> selectMoneyByAdminidAndStateOrderByCreatetimeDesc(Integer adminid, Integer state) {
        return moneyMapper.selectMoneyByAdminidAndStateOrderByCreatetimeDesc(adminid, state);
    }

    @Override
    public int sumMoneyByAdminid(Integer adminid) {
        return moneyMapper.sumMoneyByAdminid(adminid);
    }


}





